<div id="map-container">
    <!-- Map Here -->
</div>

<nav id="second-nav">
    <div class="container">
        <form action="<?php echo site_url("Home/search_process") ?>" method="POST">
            <div class="col-md-10">
                <select class="form-control input-lg" name="src_location">
                    <option value="">Select Location</option>
                    <option value="all">All Location</option>
                    <?php foreach ($select_location as $data) { ?>
                        <option value="<?php echo $data['location_name'] ?>"><?php echo $data['location_name'] ?></option>
                    <?php } ?>
                </select>
            </div>
            <div class="col-md-2">
                <button class="btn btn-lg btn-blue" type="submit" name="btn_src_location" value="search">Search</button>
            </div>                    
        </form>
    </div>
</nav>

<div id="content-outer" class="single-content">
    <div class="container">
        <div id="main" class="col-md-8">
            <?php if($location == "" || $title == ""):?>
                <div class="alert alert-danger" style="text-align:center; text-transform: capitalize">
                    <i class="fa fa-bug fa-3x"></i><br/>
                    Error. We Can't Find Post That You Are Loking For. Show <a href="<?php echo site_url('Home/search/all') ?>">All Post</a>
                </div>
            <?php else: ?>
                <ol class="breadcrumb">
                    <li><a href="<?php echo site_url() ?>">Home</a></li>
                    <li><a href="<?php echo site_url("Home/search/$location") ?>"><?php echo $location ?></a></li>
                    <li><?php echo substr($title, 0, strlen($title) - 12) ?></li>
                </ol>

                <div class="single-post-outer">
                    <h2 class="single-post-title">
                        <a href="#"><?php echo substr($title, 0,strlen($title)- 12) ?></a>
                    </h2>

                    <div class="single-post-detail">
                        <span><i class="fa fa-user"></i> <?php echo $post_author ?></span> 
                        <span><i class="fa fa-calendar"></i> <?php echo $post_date ?></span>
                        <span><i class="fa fa-tag"></i> <?php echo $post_category ?></span>
                        <span><a href="<?php echo site_url("Home/search/$location") ?>"><i class="fa fa-map-marker"></i> <?php echo $location ?></a></span>
                    </div>               

                    <div class="post-summ-single">
                        <img src="<?php echo base_url() ?>/Images/Post_Thumb/<?php echo $post_thumb ?>" class="img-responsive post-thumb" width="100%"/>
                        <?php
                        $post_content = str_replace("[br/]", "<br/>", $post_content);
                        echo $post_content;
                        ?>
                    </div>
                </div>

                <div id="author-summ">
                    <div id="auth_ava" class="col-md-2">
                        <img src="<?php echo base_url()?>Images/User_Avatar/<?php echo $post_author_ava ?>" width="100%"/>
                    </div>
                    <div id="auth_bio" class="col-md-10">
                        <p id="auth_name">
                            About <?php echo $post_author ?>
                            <span>
                                <a href="<?php echo $post_author_fb ?>" target="_blank" rel="no_follow"><i class="fa fa-facebook-square"></i></a>
                                <a href="<?php echo $post_author_twitter ?>" target="_blank" rel="no_follow"><i class="fa fa-twitter-square"></i></a>
                                <a href="<?php echo $post_author_gplus ?>" target="_blank" rel="no_follow"><i class="fa fa-google-plus-square"></i></a>
                            </span>
                        </p>
                        <?php echo $post_author_bio ?>
                    </div>
                </div>

                <div id="related-post">
                    <h3 id="related-title">Related Entries</h3>
                    <?php foreach ($related as $related_post): ?>
                        <div class="related-container">
                            <div class="col-md-4 related-thumb">
                                <img src="<?php echo base_url() ?>Images/Post_Thumb/<?php echo $related_post['thumbnail']  ?>" width="100%"/>
                            </div>
                            <div class="col-md-8">
                                <h3 class="related-item-title"><a href="<?php echo site_url("Home/post/$related_post[id_post]") ?>"><?php echo $related_post['post_title']  ?></a></h3>
                                <div class="related-details">
                                    <span class="rel-author"><i class="fa fa-fw fa-user"></i> <?php echo $related_post['fullname_user'] ?></span>&nbsp;&nbsp;
                                    <span class="rel-date"><i class="fa fa-fw fa-calendar"></i> <?php echo substr($related_post['post_date'], 0,10) ?></span>&nbsp;&nbsp;
                                    <span class="rel-location">
                                        <a href="<?php echo site_url("Home/search/$related_post[location_name]") ?>">
                                            <i class="fa fa-fw fa-map-marker"></i> <?php echo $related_post['location_name'] ?>
                                        </a>
                                    </span>
                                    <div style="clear:both/">
                                    <?php echo substr($related_post['post_content'], 0,170).". . . . ." ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php endforeach; ?>
                </div>
            <?php  endif;?>
        </div>
        
        <!-- Include the Sidebar (i_sidebar.php) -->
        <?php $this->load->view('Home_inc/i_sidebar') ?>
    </div><!-- /.content-outer -->        
</div><!-- /#content-outer -->

